const mysql = require('mysql2/promise');
// dotenv
require('dotenv').config();
// 创建连接池
const connection = mysql.createPool({
    host: 'localhost',
    port: 3306,
    // 动态获取
    user: process.env.DB_USER,
    password: process.env.DB_PASSWORD,
    database: 'magic-node',
    waitForConnections: true,
    connectionLimit: 10,
    queueLimit: 0
});

module.exports = connection;